\(\int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx\) [90]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (warning: unable to verify)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 111 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \]

[Out]

-I*arctanh((a+I*a*tan(d*x+c))^(1/2)/a^(1/2))*a^(1/2)/d+I*arctanh(1/2*(a+I*a*tan(d*x+c))^(1/2)*2^(1/2)/a^(1/2))
*2^(1/2)*a^(1/2)/d-cot(d*x+c)*(a+I*a*tan(d*x+c))^(1/2)/d

Rubi [A] (verified)

Time = 0.28 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3642, 21, 3635, 3561, 212, 3680, 65, 214} \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \]

[In]

Int[Cot[c + d*x]^2*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-I)*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/Sqrt[a]])/d + (I*Sqrt[2]*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c +
 d*x]]/(Sqrt[2]*Sqrt[a])])/d - (Cot[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]])/d

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 3561

Int[Sqrt[(a_) + (b_.)*tan[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(2*a - x^2), x], x, Sq
rt[a + b*Tan[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0]

Rule 3635

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(3/2)/((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[2*
(a^2/(a*c - b*d)), Int[Sqrt[a + b*Tan[e + f*x]], x], x] - Dist[(2*b*c*d + a*(c^2 - d^2))/(a*(c^2 + d^2)), Int[
(a - b*Tan[e + f*x])*(Sqrt[a + b*Tan[e + f*x]]/(c + d*Tan[e + f*x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] &
& NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3642

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[d*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(f*(n + 1)*(c^2 + d^2))), x] - Dist[1/(a*(c^2 + d^2)*
(n + 1)), Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1)*Simp[b*d*m - a*c*(n + 1) + a*d*(m + n + 1)*T
an[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^
2 + d^2, 0] && LtQ[n, -1] && (IntegerQ[n] || IntegersQ[2*m, 2*n])

Rule 3680

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b*(B/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x
]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && EqQ[A*b + a*B,
 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {\int \cot (c+d x) \left (\frac {i a}{2}-\frac {1}{2} a \tan (c+d x)\right ) \sqrt {a+i a \tan (c+d x)} \, dx}{a} \\ & = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {i \int \cot (c+d x) (a+i a \tan (c+d x))^{3/2} \, dx}{2 a} \\ & = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {i \int \cot (c+d x) (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)} \, dx}{2 a}-\int \sqrt {a+i a \tan (c+d x)} \, dx \\ & = -\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {(i a) \text {Subst}\left (\int \frac {1}{x \sqrt {a+i a x}} \, dx,x,\tan (c+d x)\right )}{2 d}+\frac {(2 i a) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = \frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {\text {Subst}\left (\int \frac {1}{i-\frac {i x^2}{a}} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d} \\ & = -\frac {i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.40 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.95 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\frac {-i \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )+i \sqrt {2} \sqrt {a} \text {arctanh}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )-\cot (c+d x) \sqrt {a+i a \tan (c+d x)}}{d} \]

[In]

Integrate[Cot[c + d*x]^2*Sqrt[a + I*a*Tan[c + d*x]],x]

[Out]

((-I)*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x]]/Sqrt[a]] + I*Sqrt[2]*Sqrt[a]*ArcTanh[Sqrt[a + I*a*Tan[c + d*x
]]/(Sqrt[2]*Sqrt[a])] - Cot[c + d*x]*Sqrt[a + I*a*Tan[c + d*x]])/d

Maple [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 579 vs. \(2 (89 ) = 178\).

Time = 7.93 (sec) , antiderivative size = 580, normalized size of antiderivative = 5.23

method result size
default \(-\frac {\sqrt {-\frac {a \left (2 i \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}+1\right )}{\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\, \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\, \left (-3 i \sin \left (d x +c \right ) {\left (\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1\right )}^{\frac {5}{2}}+3 i \csc \left (d x +c \right ) {\left (\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1\right )}^{\frac {3}{2}} \left (1-\cos \left (d x +c \right )\right )^{2}+6 i \sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{\sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\right ) \left (1-\cos \left (d x +c \right )\right )-3 i \csc \left (d x +c \right ) \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\, \left (1-\cos \left (d x +c \right )\right )^{2}+\left (1-\cos \left (d x +c \right )\right ) {\left (\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1\right )}^{\frac {3}{2}}-\left (\csc ^{2}\left (d x +c \right )\right ) \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\, \left (1-\cos \left (d x +c \right )\right )^{3}-3 i \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )+\sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}\right ) \left (1-\cos \left (d x +c \right )\right )-6 \sqrt {2}\, \arctan \left (\frac {\sqrt {2}\, \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}{2}\right ) \left (1-\cos \left (d x +c \right )\right )+4 \left (1-\cos \left (d x +c \right )\right ) \sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}-3 \arctan \left (\frac {1}{\sqrt {\left (\csc ^{2}\left (d x +c \right )\right ) \left (1-\cos \left (d x +c \right )\right )^{2}-1}}\right ) \left (1-\cos \left (d x +c \right )\right )\right )}{6 d \left (-\csc \left (d x +c \right )+\cot \left (d x +c \right )+i\right ) \left (1-\cos \left (d x +c \right )\right )}\) \(580\)

[In]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/6/d*(-a*(2*I*(csc(d*x+c)-cot(d*x+c))-csc(d*x+c)^2*(1-cos(d*x+c))^2+1)/(csc(d*x+c)^2*(1-cos(d*x+c))^2-1))^(1
/2)*(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2)/(-csc(d*x+c)+cot(d*x+c)+I)/(1-cos(d*x+c))*(-3*I*sin(d*x+c)*(csc(d*
x+c)^2*(1-cos(d*x+c))^2-1)^(5/2)+3*I*csc(d*x+c)*(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(3/2)*(1-cos(d*x+c))^2+6*I*2
^(1/2)*arctanh(2^(1/2)/(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2)*(csc(d*x+c)-cot(d*x+c)))*(1-cos(d*x+c))-3*I*csc
(d*x+c)*(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2)*(1-cos(d*x+c))^2+(1-cos(d*x+c))*(csc(d*x+c)^2*(1-cos(d*x+c))^2
-1)^(3/2)-csc(d*x+c)^2*(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2)*(1-cos(d*x+c))^3-3*I*ln(csc(d*x+c)-cot(d*x+c)+(
csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2))*(1-cos(d*x+c))-6*2^(1/2)*arctan(1/2*2^(1/2)*(csc(d*x+c)^2*(1-cos(d*x+c
))^2-1)^(1/2))*(1-cos(d*x+c))+4*(1-cos(d*x+c))*(csc(d*x+c)^2*(1-cos(d*x+c))^2-1)^(1/2)-3*arctan(1/(csc(d*x+c)^
2*(1-cos(d*x+c))^2-1)^(1/2))*(1-cos(d*x+c)))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 476 vs. \(2 (84) = 168\).

Time = 0.25 (sec) , antiderivative size = 476, normalized size of antiderivative = 4.29 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {2 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (4 \, {\left ({\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) - 2 \, \sqrt {2} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (4 \, {\left ({\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a e^{\left (i \, d x + i \, c\right )}\right )} e^{\left (-i \, d x - i \, c\right )}\right ) + {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (16 \, {\left (3 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, \sqrt {2} {\left (i \, a d e^{\left (3 i \, d x + 3 i \, c\right )} + i \, a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) - {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {-\frac {a}{d^{2}}} \log \left (16 \, {\left (3 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, \sqrt {2} {\left (-i \, a d e^{\left (3 i \, d x + 3 i \, c\right )} - i \, a d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} \sqrt {-\frac {a}{d^{2}}} + a^{2}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}\right ) + 4 \, \sqrt {2} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}} {\left (i \, e^{\left (3 i \, d x + 3 i \, c\right )} + i \, e^{\left (i \, d x + i \, c\right )}\right )}}{4 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )}} \]

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

-1/4*(2*sqrt(2)*(d*e^(2*I*d*x + 2*I*c) - d)*sqrt(-a/d^2)*log(4*((I*d*e^(2*I*d*x + 2*I*c) + I*d)*sqrt(a/(e^(2*I
*d*x + 2*I*c) + 1))*sqrt(-a/d^2) + a*e^(I*d*x + I*c))*e^(-I*d*x - I*c)) - 2*sqrt(2)*(d*e^(2*I*d*x + 2*I*c) - d
)*sqrt(-a/d^2)*log(4*((-I*d*e^(2*I*d*x + 2*I*c) - I*d)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(-a/d^2) + a*e^(I
*d*x + I*c))*e^(-I*d*x - I*c)) + (d*e^(2*I*d*x + 2*I*c) - d)*sqrt(-a/d^2)*log(16*(3*a^2*e^(2*I*d*x + 2*I*c) -
2*sqrt(2)*(I*a*d*e^(3*I*d*x + 3*I*c) + I*a*d*e^(I*d*x + I*c))*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(-a/d^2) +
 a^2)*e^(-2*I*d*x - 2*I*c)) - (d*e^(2*I*d*x + 2*I*c) - d)*sqrt(-a/d^2)*log(16*(3*a^2*e^(2*I*d*x + 2*I*c) - 2*s
qrt(2)*(-I*a*d*e^(3*I*d*x + 3*I*c) - I*a*d*e^(I*d*x + I*c))*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*sqrt(-a/d^2) + a
^2)*e^(-2*I*d*x - 2*I*c)) + 4*sqrt(2)*sqrt(a/(e^(2*I*d*x + 2*I*c) + 1))*(I*e^(3*I*d*x + 3*I*c) + I*e^(I*d*x +
I*c)))/(d*e^(2*I*d*x + 2*I*c) - d)

Sympy [F]

\[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int \sqrt {i a \left (\tan {\left (c + d x \right )} - i\right )} \cot ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(cot(d*x+c)**2*(a+I*a*tan(d*x+c))**(1/2),x)

[Out]

Integral(sqrt(I*a*(tan(c + d*x) - I))*cot(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.21 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {i \, a {\left (\frac {\sqrt {2} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right )}{\sqrt {a}} - \frac {\log \left (\frac {\sqrt {i \, a \tan \left (d x + c\right ) + a} - \sqrt {a}}{\sqrt {i \, a \tan \left (d x + c\right ) + a} + \sqrt {a}}\right )}{\sqrt {a}} - \frac {2 i \, \sqrt {i \, a \tan \left (d x + c\right ) + a}}{a \tan \left (d x + c\right )}\right )}}{2 \, d} \]

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

-1/2*I*a*(sqrt(2)*log(-(sqrt(2)*sqrt(a) - sqrt(I*a*tan(d*x + c) + a))/(sqrt(2)*sqrt(a) + sqrt(I*a*tan(d*x + c)
 + a)))/sqrt(a) - log((sqrt(I*a*tan(d*x + c) + a) - sqrt(a))/(sqrt(I*a*tan(d*x + c) + a) + sqrt(a)))/sqrt(a) -
 2*I*sqrt(I*a*tan(d*x + c) + a)/(a*tan(d*x + c)))/d

Giac [F]

\[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=\int { \sqrt {i \, a \tan \left (d x + c\right ) + a} \cot \left (d x + c\right )^{2} \,d x } \]

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(I*a*tan(d*x + c) + a)*cot(d*x + c)^2, x)

Mupad [B] (verification not implemented)

Time = 4.60 (sec) , antiderivative size = 97, normalized size of antiderivative = 0.87 \[ \int \cot ^2(c+d x) \sqrt {a+i a \tan (c+d x)} \, dx=-\frac {\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{\sqrt {-a}}\right )\,1{}\mathrm {i}}{d}-\frac {\mathrm {cot}\left (c+d\,x\right )\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{d}+\frac {\sqrt {2}\,\sqrt {-a}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{2\,\sqrt {-a}}\right )\,1{}\mathrm {i}}{d} \]

[In]

int(cot(c + d*x)^2*(a + a*tan(c + d*x)*1i)^(1/2),x)

[Out]

(2^(1/2)*(-a)^(1/2)*atan((2^(1/2)*(a + a*tan(c + d*x)*1i)^(1/2))/(2*(-a)^(1/2)))*1i)/d - (cot(c + d*x)*(a + a*
tan(c + d*x)*1i)^(1/2))/d - ((-a)^(1/2)*atan((a + a*tan(c + d*x)*1i)^(1/2)/(-a)^(1/2))*1i)/d